package com.parenting.feigncontroller;

import cn.hutool.core.bean.BeanUtil;
import com.parenting.entities.OrdersDO;
import com.parenting.feign.controller.IFeignAppletOrderController;
import com.parenting.feign.entities.OrderDTO;
import com.parenting.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class FeignAppletOrderController implements IFeignAppletOrderController {

    @Autowired
    private OrdersService ordersService;

    @Override
    public OrderDTO getOrderById(String orderId) {
        OrdersDO byId = ordersService.getById(orderId);
        if (null!=byId){
            return  BeanUtil.copyProperties(byId,OrderDTO.class);
        }
        return null;
    }
}
